//package com.kay.restdemo.server.exception;
//
//import com.kay.restdemo.server.domain.ErrorInfo;
//import org.slf4j.LoggerFactory;
//import org.springframework.web.bind.annotation.*;
//
//import javax.servlet.http.HttpServletRequest;
//import java.util.logging.Logger;
//
////@ControllerAdvice
//@RestControllerAdvice
//public class GrobalExceptionHandler {
////    private Logger logger = LoggerFactory.getLogger()
//    @ExceptionHandler(value = MyException.class)  // 绑定 异常
////    @ResponseBody
//    public ErrorInfo<String> jsonErrorHandler(HttpServletRequest req, MyException e) throws Exception{
//        ErrorInfo<String> errorInfo = new ErrorInfo<String>();
//        errorInfo.setMessage(e.getMessage());
//        errorInfo.setCode(ErrorInfo.ERROR);
//        errorInfo.setData("show error informations");
//        errorInfo.setUrl(req.getRequestURI().toString());
//        return errorInfo;
//    }
//}
